<?php
namespace  app\index\validate;

use think\Validate;
class Student extends Validate
{
	//定义规则
	protected  $rule=[
			"name" => "require|min:4|max:10",
			"email" => "email",
			'age' => "integer",
			
	];
	
	protected $message=[
		"name.require" =>"姓名不能为空",
		"name.min"=>"姓名不能小于4个字符",
		"age.integer" =>"年龄必须是整数",
	];
	protected  $scene =[
		'add' => ['name','email'],
		'edit' => ['age'],
			
	];
}